home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / CTBUtilities.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  6.3 KB  |  246 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        CTBUtilities.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __CTBUTILITIES__
  13. #define __CTBUTILITIES__
  14.  
  15. #ifndef    __MEMORY__
  16. #include <Memory.h>
  17. /*    #include <Types.h>                                            */
  18. /*        #include <ConditionalMacros.h>                            */
  19. /*        #include <MixedMode.h>                                    */
  20. /*            #include <Traps.h>                                    */
  21. #endif
  22.  
  23. #ifndef __STANDARDFILE__
  24. #include <StandardFile.h>
  25. /*    #include <Dialogs.h>                                        */
  26. /*        #include <Windows.h>                                    */
  27. /*            #include <Quickdraw.h>                                */
  28. /*                #include <QuickdrawText.h>                        */
  29. /*                    #include <IntlResources.h>                    */
  30. /*            #include <Events.h>                                    */
  31. /*                #include <OSUtils.h>                            */
  32. /*            #include <Controls.h>                                */
  33. /*                #include <Menus.h>                                */
  34. /*        #include <TextEdit.h>                                    */
  35. /*    #include <Files.h>                                            */
  36. /*        #include <SegLoad.h>                                    */
  37. #endif
  38.  
  39. #ifndef __APPLETALK__
  40. #include <AppleTalk.h>
  41. #endif
  42.  
  43. enum  {
  44. /*    version of Comm Toolbox Utilities    */
  45.     curCTBUVersion                = 2,
  46. /*    Error codes/types    */
  47.     ctbuGenericError            = -1,
  48.     ctbuNoErr                    = 0
  49. };
  50.  
  51. typedef OSErr CTBUErr;
  52.  
  53. enum  {
  54.     chooseDisaster                = -2,
  55.     chooseFailed,
  56.     chooseAborted,
  57.     chooseOKMinor,
  58.     chooseOKMajor,
  59.     chooseCancel
  60. };
  61.  
  62. typedef unsigned short ChooseReturnCode;
  63.  
  64. enum  {
  65.     nlOk,
  66.     nlCancel,
  67.     nlEject
  68. };
  69.  
  70. typedef unsigned short NuLookupReturnCode;
  71.  
  72. enum  {
  73.     nameInclude                    = 1,
  74.     nameDisable,
  75.     nameReject
  76. };
  77.  
  78. typedef unsigned short NameFilterReturnCode;
  79.  
  80. enum  {
  81.     zoneInclude                    = 1,
  82.     zoneDisable,
  83.     zoneReject
  84. };
  85.  
  86. typedef unsigned short ZoneFilterReturnCode;
  87.  
  88. typedef pascal short (*DialogHookProcPtr)(short item, DialogPtr theDialog);
  89.  
  90. enum {
  91.     uppDialogHookProcInfo = kPascalStackBased
  92.          | RESULT_SIZE(SIZE_CODE(sizeof(short)))
  93.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  94.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DialogPtr)))
  95. };
  96.  
  97. #if USESROUTINEDESCRIPTORS
  98. typedef UniversalProcPtr DialogHookUPP;
  99.  
  100. #define CallDialogHookProc(userRoutine, item, theDialog)        \
  101.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDialogHookProcInfo, (item), (theDialog))
  102. #define NewDialogHookProc(userRoutine)        \
  103.         (DialogHookUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDialogHookProcInfo, GetCurrentISA())
  104. #else
  105. typedef DialogHookProcPtr DialogHookUPP;
  106.  
  107. #define CallDialogHookProc(userRoutine, item, theDialog)        \
  108.         (*(userRoutine))((item), (theDialog))
  109. #define NewDialogHookProc(userRoutine)        \
  110.         (DialogHookUPP)(userRoutine)
  111. #endif
  112.  
  113. enum  {
  114. /*    Values for hookProc items        */
  115.     hookOK                        = 1,
  116.     hookCancel                    = 2,
  117.     hookOutline                    = 3,
  118.     hookTitle                    = 4,
  119.     hookItemList                = 5,
  120.     hookZoneTitle                = 6,
  121.     hookZoneList                = 7,
  122.     hookLine                    = 8,
  123.     hookVersion                    = 9,
  124.     hookReserved1                = 10,
  125.     hookReserved2                = 11,
  126.     hookReserved3                = 12,
  127.     hookReserved4                = 13,
  128. /*    "virtual" hookProc items    */
  129.     hookNull                    = 100,
  130.     hookItemRefresh                = 101,
  131.     hookZoneRefresh                = 102,
  132.     hookEject                    = 103,
  133.     hookPreflight                = 104,
  134.     hookPostflight                = 105,
  135.     hookKeyBase                    = 1000
  136. };
  137.  
  138.  
  139. /*    NuLookup structures/constants    */
  140.  
  141. #if defined(powerc) || defined (__powerc)
  142. #pragma options align=mac68k
  143. #endif
  144. struct NLTypeEntry {
  145.     Handle                        hIcon;
  146.     Str32                        typeStr;
  147. };
  148. #if defined(powerc) || defined(__powerc)
  149. #pragma options align=reset
  150. #endif
  151.  
  152. typedef struct NLTypeEntry NLTypeEntry;
  153.  
  154. typedef NLTypeEntry NLType[4];
  155.  
  156. #if defined(powerc) || defined (__powerc)
  157. #pragma options align=mac68k
  158. #endif
  159. struct NBPReply {
  160.     EntityName                    theEntity;
  161.     AddrBlock                    theAddr;
  162. };
  163. #if defined(powerc) || defined(__powerc)
  164. #pragma options align=reset
  165. #endif
  166.  
  167. typedef struct NBPReply NBPReply;
  168.  
  169. typedef pascal short (*NameFilterProcPtr)(const EntityName *theEntity);
  170.  
  171. enum {
  172.     uppNameFilterProcInfo = kPascalStackBased
  173.          | RESULT_SIZE(SIZE_CODE(sizeof(short)))
  174.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(EntityName*)))
  175. };
  176.  
  177. #if USESROUTINEDESCRIPTORS
  178. typedef UniversalProcPtr NameFilterUPP;
  179.  
  180. #define CallNameFilterProc(userRoutine, theEntity)        \
  181.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppNameFilterProcInfo, (theEntity))
  182. #define NewNameFilterProc(userRoutine)        \
  183.         (NameFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppNameFilterProcInfo, GetCurrentISA())
  184. #else
  185. typedef NameFilterProcPtr NameFilterUPP;
  186.  
  187. #define CallNameFilterProc(userRoutine, theEntity)        \
  188.         (*(userRoutine))((theEntity))
  189. #define NewNameFilterProc(userRoutine)        \
  190.         (NameFilterUPP)(userRoutine)
  191. #endif
  192.  
  193. typedef pascal short (*ZoneFilterProcPtr)(Str32 theZone);
  194.  
  195. enum {
  196.     uppZoneFilterProcInfo = kPascalStackBased
  197.          | RESULT_SIZE(SIZE_CODE(sizeof(short)))
  198.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void* /* is array */)))
  199. };
  200.  
  201. #if USESROUTINEDESCRIPTORS
  202. typedef UniversalProcPtr ZoneFilterUPP;
  203.  
  204. #define CallZoneFilterProc(userRoutine, theZone)        \
  205.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppZoneFilterProcInfo, (theZone))
  206. #define NewZoneFilterProc(userRoutine)        \
  207.         (ZoneFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppZoneFilterProcInfo, GetCurrentISA())
  208. #else
  209. typedef ZoneFilterProcPtr ZoneFilterUPP;
  210.  
  211. #define CallZoneFilterProc(userRoutine, theZone)        \
  212.         (*(userRoutine))((theZone))
  213. #define NewZoneFilterProc(userRoutine)        \
  214.         (ZoneFilterUPP)(userRoutine)
  215. #endif
  216.  
  217. typedef NameFilterProcPtr nameFilterProcPtr;
  218.  
  219. typedef ZoneFilterProcPtr zoneFilterProcPtr;
  220.  
  221. #ifdef __cplusplus
  222. extern "C" {
  223. #endif
  224.  
  225. extern pascal CTBUErr InitCTBUtilities(void);
  226. extern pascal short CTBGetCTBVersion(void);
  227. extern pascal short StandardNBP(Point where, ConstStr255Param prompt, short numTypes, NLType typeList, NameFilterUPP nameFilter, ZoneFilterUPP zoneFilter, DialogHookUPP hook, NBPReply *theReply);
  228. extern pascal short CustomNBP(Point where, ConstStr255Param prompt, short numTypes, NLType typeList, NameFilterUPP nameFilter, ZoneFilterUPP zoneFilter, DialogHookUPP hook, long userData, short dialogID, ModalFilterUPP filter, NBPReply *theReply);
  229. #if OLDROUTINENAMES
  230. #define NuLookup(where, prompt, numTypes, typeList, nameFilter, zoneFilter, hook, theReply)  \
  231.     StandardNBP(where, prompt, numTypes, typeList, nameFilter, zoneFilter,  \
  232.     hook, theReply)
  233.  
  234. #define NuPLookup(where, prompt, numTypes, typeList, nameFilter, zoneFilter, hook, userData, dialogID, filter, theReply)  \
  235.     CustomNBP(where, prompt, numTypes, typeList, nameFilter,  \
  236.     zoneFilter, hook, userData, dialogID, filter, theReply)
  237.  
  238. #endif
  239.  
  240. #ifdef __cplusplus
  241. }
  242. #endif
  243.  
  244. #endif
  245.  
  246.